-
Notifications
You must be signed in to change notification settings - Fork 2.2k
backport: readd global lock for postgres and the channeldb_kv table #10397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backport: readd global lock for postgres and the channeldb_kv table #10397
Conversation
dd44b40 to
45ea9d6
Compare
45ea9d6 to
6d99e68
Compare
Add two configuration options to control global lock usage for different postgres database backends: - ChannelDBWithGlobalLock: for channeldb access (default: false) - WalletDBWithGlobalLock: for wallet database access (default: true) These allow fine-grained control over which databases use global locks, rather than hardcoding the behavior. This is a temporary measure until the revocation log and wallet are migrated to native SQL and become fully concurrent-safe.
1d1ccc7 to
e8a803b
Compare
Replace hardcoded WithGlobalLock assignment with configurable options wallet postgres backends. Also add the WithGlobalLock option to the channeldb table for postgres backends. Defaults: - channeldb: false (allow concurrent access) - wallet: true (maintain safe single-writer behavior) Users can now override these defaults via: - db.postgres.channeldb-with-global-lock - db.postgres.walletdb-with-global-lock This gives operators flexibility while maintaining safe defaults until full native SQL migration is complete. Moreover exclude db.postgres.walletdb-with-global-lock check in the sample config file script. We cannot easily check the correct default because we set it later in the LND startup sequence so we exclude it.
e8a803b to
6bdfb1d
Compare
|
short note here, this backport is a bit different to the master PR because we had to add the relativ sqldb reference here, since in master this reference to the local sqldb package was already present. |
starius
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 💾
saubyk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
|
|
||
| // Use the local sqldb package for development. | ||
| // TODO(norbert): remove once sqldb package is tagged. | ||
| replace github.com/lightningnetwork/lnd/sqldb => ./sqldb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to tag post merge.
4eaf57d
into
lightningnetwork:v0.20.x-branch
backports #10394